<?php
     if(isset($_GET['secao'])){
                    session_start();
                    if(strcmp(session_id(),$_GET['secao'])==1){
                        header('Location: Login.php');
                    }
echo "<html>";
    echo    "<head>";
       echo "<title></title>";
        echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
        echo "<Link rel=\"stylesheet\" href=\"Forms.css\" type=\"text/css\"/>";
        
    echo "</head>";

        
                    if(isset ($_GET['act']) && strcasecmp($_GET['act'],"alt")==0){
                        include_once 'Conexao.php';
                        $bd = new Conexao();
                        $bd->conectar();
                        $chave = $_GET['id'];
                        $obj=$bd->selectFuncionario($chave,2);
                        $info = mysql_fetch_array($obj);
                        $act = "altFuncionario";
                   }else
                       $act = "cadFuncionario";
         
    echo "<body>";
        echo "<form method=\"POST\" action=\"Inserts.php?act=$act&id="; if(isset($_GET['id'])){ echo $_GET['id'];}else echo null; echo "\"  enctype=\"multipart/form-data\" >";
            echo "<table><caption>Dados do funcionário</caption>";
                echo "<tr/>";
                    echo "<td/>*Nome:";
                    echo "<td/><input type=\"text\" name=\"nome\" value= \"";if(isset($info['Nome']))echo $info['Nome']; echo"\">";
                echo "<tr/>";
                    echo "<td/>*Usuário:";
                    echo "<td/><input type=\"text\" name=\"usuario\" value="; if(isset($info['usuario']))echo $info['usuario']; echo ">";
                echo "<tr/>";
                    echo "<td/>*Senha:";
                    echo "<td/><input type =\"password\" name=\"senha\">";
                echo "<tr/>";
                    echo "<td/>*Confirme a senha:";
                    echo "<td/><input type =\"password\" name=\"confirmaSenha\">";
                echo "<tr/>";
                    echo "<td align=\"right\">";
                    echo "<input type=\"submit\" name=\"enviar\" value=\"Confirmar\">";
                    echo "<td/>";
                    echo "<input type=\"reset\" name=\"limpar\" value=\"Limpar\">";
            echo "</table>";
        echo "</form>";
    echo "</body>";
echo "</html>";
}else{
       header('Location: Login.php');
 }
 ?>